package hu.ikti.gateway.impl;

import org.apache.log4j.ConsoleAppender;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;

public class CustomLogService {

	public static Logger logger;
	
	private static void initLogger() {
		logger = Logger.getRootLogger();
		logger.addAppender(new ConsoleAppender(new PatternLayout("%-5p [%t]: %m%n")));
	}
	
	public static void info(String s){
		if (logger == null) initLogger();
		logger.info(s);
	}
		
	public static void warn(String s){
		if (logger == null) initLogger();
		logger.warn(s);
	}	
		
	public static void error(String s){
		if (logger == null) initLogger();
		logger.error(s);
	}	
}
